<?php
/**
 * 回答管理控制器类
 */
namespace Admin\Controller;
use Think\Controller;

class AnswerController extends CommonController
{
    public function ans_list()
    {
        $list = M('answer a1')->join('left join answer_ext ae on a1.aid=ae.aid inner join users u1 on u1.uid=a1.uid')->field('a1.aid,a1.qid,a1.content,a1.atime,a1.is_great,ae.praise,u1.uname')->select();
        $this->assign('list', $list);
        $this->display();
    }

    public function ans_edit()
    {
        $get_data = I('get.aid');
        $content = M('answer')->where('aid='.$get_data)->field('aid,content')->find();
        $this->assign('content', $content);
        $this->display();
    }

    public function ans_del()
    {
        $this->ajaxReturn($info);
    }
}